package edu.cuit.zhuyimeng.framework.common.result;

/**
 * 全局状态码枚举
 */
public interface HttpStatusCodeConstants {

    CodeWrapper SUCCESS = new CodeWrapper(200, "成功");

    // ========== 客户端错误段 ==========

    CodeWrapper BAD_REQUEST = new CodeWrapper(400, "请求参数不正确");
    CodeWrapper UNAUTHORIZED = new CodeWrapper(401, "账号未登录");
    CodeWrapper FORBIDDEN = new CodeWrapper(403, "没有该操作权限");
    CodeWrapper NOT_FOUND = new CodeWrapper(404, "请求未找到");
    CodeWrapper METHOD_NOT_ALLOWED = new CodeWrapper(405, "请求方法不正确");
    CodeWrapper CONFLICT = new CodeWrapper(409, "请求资源冲突");
    CodeWrapper LOCKED = new CodeWrapper(423, "请求失败，请稍后重试"); // 并发请求，不允许
    CodeWrapper TOO_MANY_REQUESTS = new CodeWrapper(429, "请求过于频繁，请稍后重试");

    // ========== 服务端错误段 ==========

    CodeWrapper INTERNAL_SERVER_ERROR = new CodeWrapper(500, "系统异常");
    CodeWrapper NOT_IMPLEMENTED = new CodeWrapper(501, "功能未实现/未开启");
    CodeWrapper ERROR_CONFIGURATION = new CodeWrapper(502, "错误的配置项");

    // ========== 自定义错误段 ==========
    CodeWrapper REPEATED_REQUESTS = new CodeWrapper(900, "重复请求，请稍后重试"); // 重复请求
    CodeWrapper DEMO_DENY = new CodeWrapper(901, "演示模式，禁止写操作");
    CodeWrapper UNKNOWN = new CodeWrapper(999, "未知错误");

}
